package com.dyp.multi_data_source.ctr;

import com.dyp.multi_data_source.entity.Author;
//import com.dyp.multi_data_source.repository.AuthorDao;
import com.dyp.multi_data_source.service.AuthorService;
//import jakarta.transaction.Transactional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/v1")
public class TestCtr {

    private final Logger LOG = LoggerFactory.getLogger(TestCtr.class);

    private final AuthorService authorDao;
    public TestCtr(AuthorService authorDao){
        this.authorDao = authorDao;
    }


    @RequestMapping(value = "{name}")
    public String sayHi1(@PathVariable(name = "name")
                         String name)
    {
        String author = authorDao.slectctById();
        LOG.debug("sayHi1");
        return "hi " + name + " : " + author   ;
    }

}
